package com.itheima.demo01;

import java.util.HashMap;

public class HashMapDemp {

    public static void main(String[] args) {

        Student s = new Student("zhangsan",12);
        Student s1 = new Student("lisi",14);
        Student s2 = new Student("zhaoliu",15);

        HashMap<Student,String> hashMap = new HashMap<Student,String>();

        hashMap.put(s,"广东");
        hashMap.put(s1,"广西");
        hashMap.put(s2,"广南");
        hashMap.put(s2,"广北");

        hashMap.forEach((student, s3) -> {
            String name = student.getName();
            int age = student.getAge();
            System.out.println(name+"   "+age+"   "+s3);
        });
    }
}
